<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>专业登录注册系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
    <style>
        /* 基础重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', sans-serif;
            height: 100vh;
            overflow: hidden;
            color: #333;
        }

        /* 主容器 */
        .container {
            display: flex;
            height: 100vh;
        }

        /* 左侧品牌区 */
        .brand-section {
            flex: 1;
            background: linear-gradient(135deg, rgba(41, 82, 255, 0.8), rgba(86, 67, 253, 0.8)),
            url('https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80') center/cover;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        .brand-content {
            max-width: 80%;
            z-index: 2;
            text-align: center;
        }

        .brand-content h1 {
            font-size: 2.5rem;
            margin-bottom: 1.5rem;
            font-weight: 600;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        }

        .dynamic-text-container {
            min-height: 4rem;
            margin-bottom: 2rem;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .dynamic-text {
            font-size: 1.5rem;
            opacity: 0.9;
            text-align: center;
            height: 2.5rem;
        }

        .brand-content p {
            font-size: 1.5rem;
            margin-bottom: 3rem;
            opacity: 0.9;
        }

        .features {
            margin-top: 3rem;
            text-align: left;
        }

        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .feature-item i {
            font-size: 1.2rem;
            margin-right: 1rem;
            color: rgba(255, 255, 255, 0.8);
        }

        /* 右侧表单区 */
        .form-section {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #f8fafc;
            position: relative;
        }

        .form-wrapper {
            width: 100%;
            max-width: 450px;
            padding: 0 2rem;
            position: relative;
            height: 100%;
            display: flex;
            align-items: center;
        }

        .form {
            background: white;
            padding: 2.5rem;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
            width: 100%;
            position: absolute;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
        }

        .form.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .form h2 {
            font-size: 1.8rem;
            margin-bottom: 2rem;
            color: #2d3748;
            font-weight: 600;
            text-align: center;
        }

        /* 表单组样式 */
        .form-group {
            position: relative;
            margin-bottom: 1.8rem;
        }

        .form-group input {
            width: 100%;
            padding: 15px 0;
            border: none;
            border-bottom: 1px solid #e2e8f0;
            font-size: 1rem;
            background: transparent;
            transition: all 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-bottom-color: transparent;
        }

        .form-group label {
            position: absolute;
            top: 15px;
            left: 0;
            color: #94a3b8;
            font-size: 1rem;
            transition: all 0.3s;
            pointer-events: none;
        }

        .form-group input:focus + label,
        .form-group input:not(:placeholder-shown) + label {
            top: -10px;
            font-size: 0.8rem;
            color: #4f46e5;
        }

        .focus-line {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: #4f46e5;
            transition: all 0.4s;
        }

        .form-group input:focus ~ .focus-line {
            width: 100%;
        }

        /* 表单选项 */
        .form-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 1.5rem 0;
        }

        .remember-me {
            display: flex;
            align-items: center;
            cursor: pointer;
            font-size: 0.9rem;
            color: #64748b;
        }

        .remember-me input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
        }

        .checkmark {
            display: inline-block;
            width: 18px;
            height: 18px;
            margin-right: 8px;
            border: 1px solid #cbd5e1;
            border-radius: 4px;
            position: relative;
            transition: all 0.2s;
        }

        .remember-me input:checked ~ .checkmark {
            background: #4f46e5;
            border-color: #4f46e5;
        }

        .checkmark:after {
            content: "";
            position: absolute;
            display: none;
            left: 6px;
            top: 2px;
            width: 5px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

        .remember-me input:checked ~ .checkmark:after {
            display: block;
        }

        .forgot-password {
            color: #64748b;
            font-size: 0.9rem;
            text-decoration: none;
            transition: color 0.2s;
        }

        .forgot-password:hover {
            color: #4f46e5;
        }

        /* 按钮样式 */
        .btn {
            position: relative;
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            overflow: hidden;
            transition: all 0.3s;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .btn-primary {
            background: #4f46e5;
            color: white;
            box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
        }

        .btn-primary:hover {
            background: #4338ca;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
        }

        .btn-text {
            position: relative;
            z-index: 2;
        }

        .btn-icon {
            margin-left: 10px;
            font-size: 0.9rem;
            transition: all 0.3s;
        }

        .btn-primary:hover .btn-icon {
            transform: translateX(5px);
        }

        /* 社交登录 */
        .social-login {
            margin: 2rem 0;
            text-align: center;
        }

        .social-login p {
            color: #64748b;
            font-size: 0.9rem;
            margin-bottom: 1rem;
            position: relative;
        }

        .social-login p:before,
        .social-login p:after {
            content: "";
            position: absolute;
            top: 50%;
            width: 30%;
            height: 1px;
            background: #e2e8f0;
        }

        .social-login p:before {
            left: 0;
        }

        .social-login p:after {
            right: 0;
        }

        .social-icons {
            display: flex;
            justify-content: center;
            gap: 1rem;
        }

        .social-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            font-size: 1.2rem;
            transition: all 0.3s;
        }

        .social-icon:hover {
            transform: translateY(-3px);
        }

        .wechat {
            background: #07C160;
        }

        .weibo {
            background: #E6162D;
        }

        .github {
            background: #333;
        }

        /* 切换链接 */
        .toggle-form {
            text-align: center;
            color: #64748b;
            font-size: 0.95rem;
            margin-top: 1.5rem;
        }

        .toggle-form a {
            color: #4f46e5;
            font-weight: 500;
            text-decoration: none;
            transition: all 0.2s;
        }

        .toggle-form a:hover {
            text-decoration: underline;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                flex-direction: column;
            }

            .brand-section {
                padding: 2rem;
                flex: none;
                height: 30vh;
            }

            .form-section {
                flex: none;
                height: 70vh;
                padding: 2rem;
            }

            .form-wrapper {
                padding: 0;
            }

            .brand-content h1 {
                font-size: 1.8rem;
            }

            .brand-content p {
                font-size: 1.2rem;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <!-- 左侧品牌区 -->
    <div class="brand-section">
        <div class="brand-content">
            <h1 id="animated-title">欢迎来到我们的平台</h1>
            <div class="dynamic-text-container">
                <div class="dynamic-text" id="dynamic-text"></div>
                <span class="cursor"></span>
            </div>
            <div class="features">
                <div class="feature-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>企业级安全保障</span>
                </div>
                <div class="feature-item">
                    <i class="fas fa-bolt"></i>
                    <span>极速响应体验</span>
                </div>
            </div>
        </div>
    </div>

    <!-- 右侧表单区 -->
    <div class="form-section">
        <div class="form-wrapper">
            <!-- 登录表单 -->
            <form id="login-form" class="form active">
                <h2>用户登录</h2>

                <div class="form-group">
                    <input type="email" id="login-email" placeholder="请输入邮箱或用户名" required>
                    <label for="login-email">邮箱/用户名</label>
                </div>

                <div class="form-group">
                    <input type="password" id="login-password" placeholder="请输入密码" required>
                    <label for="login-password">密码</label>
                </div>

                <div class="form-options">
                    <label class="remember-me">
                        <input type="checkbox">
                        <span class="checkmark"></span>
                        记住我
                    </label>
                    <a href="#" class="forgot-password">忘记密码？</a>
                </div>

                <button type="submit" class="btn btn-primary">
                    <span class="btn-text">登录</span>
                    <i class="fas fa-arrow-right btn-icon"></i>
                </button>

                <div class="social-login">
                    <p>快速登录</p>
                    <div class="social-icons">
                        <a href="#" class="social-icon wechat">
                            <i class="fab fa-weixin"></i>
                        </a>
                        <a href="#" class="social-icon weibo">
                            <i class="fab fa-weibo"></i>
                        </a>
                        <a href="#" class="social-icon github">
                            <i class="fab fa-github"></i>
                        </a>
                    </div>
                </div>

                <p class="toggle-form">
                    还没有账号？ <a href="#" id="show-register">立即注册</a>
                </p>
            </form>

            <!-- 注册表单 -->
            <form id="register-form" class="form">
                <h2>创建账号</h2>

                <div class="form-group">
                    <input type="text" id="register-username" placeholder="请输入用户名" required>
                    <label for="register-username">用户名</label>
                </div>

                <div class="form-group">
                    <input type="email" id="register-email" placeholder="请输入邮箱地址" required>
                    <label for="register-email">邮箱地址</label>
                </div>

                <div class="form-group">
                    <input type="password" id="register-password" placeholder="请设置密码（至少8位）" required>
                    <label for="register-password">设置密码</label>
                </div>

                <div class="form-group">
                    <input type="password" id="register-confirm-password" placeholder="请再次输入密码" required>
                    <label for="register-confirm-password">确认密码</label>
                </div>

                <div class="form-checkbox">
                    <label>
                        <input type="checkbox" required>
                        <span class="checkmark"></span>
                        我已阅读并同意<a href="#">服务条款</a>
                    </label>
                </div>

                <button type="submit" class="btn btn-primary">
                    <span class="btn-text">立即注册</span>
                    <i class="fas fa-user-plus btn-icon"></i>
                </button>

                <p class="toggle-form">
                    已有账号？ <a href="#" id="show-login">立即登录</a>
                </p>
            </form>
        </div>
    </div>
</div>

<!-- 引入GSAP库 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>

<script>
    document.addEventListener('DOMContentLoaded', function() {
        // 表单切换
        const loginForm = document.getElementById('login-form');
        const registerForm = document.getElementById('register-form');
        const showRegister = document.getElementById('show-register');
        const showLogin = document.getElementById('show-login');

        // 初始化登录表单为激活状态
        gsap.set(loginForm, { opacity: 1, visibility: 'visible', y: 0 });
        loginForm.classList.add('active');

        // 切换表单函数
        function switchForm(hideForm, showForm) {
            const tl = gsap.timeline();

            tl.to(hideForm, {
                opacity: 0,
                y: 20,
                duration: 0.4,
                ease: "power2.inOut",
                onComplete: () => {
                    hideForm.classList.remove('active');
                }
            })
                .to(showForm, {
                    opacity: 1,
                    y: 0,
                    duration: 0.4,
                    ease: "power2.inOut",
                    onStart: () => {
                        showForm.classList.add('active');
                    }
                }, "-=0.3");
        }

        // 事件监听
        showRegister.addEventListener('click', function(e) {
            e.preventDefault();
            switchForm(loginForm, registerForm);
        });

        showLogin.addEventListener('click', function(e) {
            e.preventDefault();
            switchForm(registerForm, loginForm);
        });

        // 真正的打字机效果
        const dynamicText = document.getElementById('dynamic-text');
        const textLines = [
            "10,000+开发者社区",
            "全球技术交流平台",
            "创新科技生态圈"
        ];

        let currentLine = 0;
        let isDeleting = false;
        let charIndex = 0;
        let typingSpeed = 100;

        function typeWriter() {
            const currentText = textLines[currentLine];

            if (isDeleting) {
                // 删除效果
                dynamicText.textContent = currentText.substring(0, charIndex - 1);
                charIndex--;
                typingSpeed = 50;
            } else {
                // 打字效果
                dynamicText.textContent = currentText.substring(0, charIndex + 1);
                charIndex++;
                typingSpeed = 100;
            }

            // 判断状态切换
            if (!isDeleting && charIndex === currentText.length) {
                isDeleting = true;
                typingSpeed = 1500; // 暂停一下
            } else if (isDeleting && charIndex === 0) {
                isDeleting = false;
                currentLine = (currentLine + 1) % textLines.length;
                typingSpeed = 500; // 换行暂停
            }

            setTimeout(typeWriter, typingSpeed);
        }

        // 初始化打字效果
        if (dynamicText) {
            setTimeout(typeWriter, 1000);
        }

        // 品牌区动画
        gsap.from("#animated-title", {
            y: -30,
            opacity: 0,
            duration: 1,
            delay: 0.3,
            ease: "power3.out"
        });

        gsap.from(".dynamic-text-container", {
            y: 20,
            opacity: 0,
            duration: 1,
            delay: 0.6,
            ease: "power3.out"
        });

        gsap.from(".feature-item", {
            y: 20,
            opacity: 0,
            duration: 0.8,
            delay: 0.9,
            stagger: 0.2,
            ease: "power3.out"
        });
    });
</script>
</body>
</html>